import React from "react"
import "./modal.scss"
import { images } from "../../assets"

interface IModalProps {
  modalText: string
  modalSubText?: string
  closeErrorModal?: () => void
}

export class Modal extends React.Component<IModalProps, {}> {
  render() {
    return (
      <div className="modal-wrap">
        <div className="modal-content">
          <div className="modal-header">
            <img
              alt=""
              className="header-icon"
              src={images.login.icons.clear}
              onClick={this.props.closeErrorModal}
            />
          </div>
          <div className="modal-container">
            <img alt="" className="modal-prompt" src={images.login.icons.popUpsPrompt} />
            <div className="prompt-text">{this.props.modalText}</div>
            <div className="prompt-sub-text">{this.props.modalSubText}</div>
          </div>
          <div className="modal-bottom">联系在线客服</div>
        </div>
      </div>
    )
  }
}
